package cn.shop.alibaba.service.impl;


import cn.shop.alibaba.beans.Product;
import cn.shop.alibaba.mapper.ProductMapper;
import cn.shop.alibaba.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ProductServiceImpl implements ProductService {

    @Autowired
    private ProductMapper productMapper;
    @Override
    public Product getProductByProductId(Long pid) {
        Product product = productMapper.selectById(pid);
        return product;
    }

    @Override
    public int updateProductStockByid(Integer count, Long pid) {
        return productMapper.updateProductStockByid(count,pid);
    }
}
